<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title></title> 
    <script>
        const electron = require('electron');
        const ipcRenderer = electron.ipcRenderer;
    </script>
    <script src="i18n/i18n.js"></script>
    <style>
        body{
            background-color: azure;
            color:  #446fbd;
        }
        
        #video-url{
            width: 100%;
            height: 20px;
            line-height: 20px;
        }
        #btn-ok{
            margin: 20px 40px;
            background-color:darkseagreen;
            color: white;
            font-size: 14px;
            padding: 6px 24px;
            cursor: pointer;
            box-shadow: 1px 1px 2px black;
            border-radius: 4px;
            cursor: pointer;
        }
        #btn-ok:hover{
            background-color:seagreen;
        }
        #btn-ok:active{
            box-shadow: 0px 0px 1px black;
        }
        #text-container{
            margin-top: 15px;
            margin-bottom: 15px;
        }
        #btn-container{
            text-align: center;
        }
    </style>
  </head>
  <body>
    <div id="text-container">
        <input id="video-url" type="text"/>
    </div>
    <div id="btn-container">
        <a role="button" id="btn-ok"></a>
    </div>
    <script>
        // init i18n
        i18n.init();  
        var videoUrl = document.getElementById("video-url");
        videoUrl.placeholder = i18n.prop('open-video-by-url.placeholder-input');
        
        document.title = i18n.prop('menu.open-video-by-url');
        
        document.getElementById("btn-ok").innerHTML = i18n.prop("switch-language.btn-ok");
        // ok
        document.getElementById("btn-ok").onclick = function(){
            if(videoUrl.value!=""){
                ipcRenderer.send("async-open-video-by-url",videoUrl.value);
            }else{
                alert(i18n.prop('open-video-by-url.require-input'));
            }
        }
    </script>
  </body>
</html>